<!--<include file="public+header">-->

<!--{style}-->
.tablesorter td {border:none;}
#preview-img img{max-width:150px;max-height:200px;}
<!--{/style}-->

<!--{script}-->
$(document).ready(function(){
	$('#jiajucompanyvip_template').change(function (){
		var self = $(this);
		$('#preview-img').html('<img src="<!--{:__PUBLIC__}-->/images/common/ajax/loading.gif" />');
		$('#preview-img').html('<a title="'+$('option:selected', self).text()+'" href="'+$('option:selected', self).attr('data-url')+'" target="_blank"><img src="'+$('option:selected', self).attr('data-img')+'"/></a>');
	});

	$('#jiajucompanyvip_template option:selected').change();
});

function insertImg_(nAttachmentid,id){
	insertAttachmentthumb(id,nAttachmentid);
}

function insertImg1(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_1');
}

function insertImg2(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_2');
}

function insertImg3(nAttachmentid){
	insertImg_(nAttachmentid,'jiajucompanybanner_3');
}

function updateTemplate(){
	$("#submit_button").attr("disabled", "disabled");
	$("#submit_button").val( 'add...' );
	Q.AjaxSubmit('templateAdd','<!--{:Q::U('jiajucompanytemplate/template')}-->','',complete);
}

function complete(data,status){
	$("#submit_button").attr("disabled", false);
	$("#submit_button").val( '更新' );
	if(status==1){
	}
}
<!--{/script}-->

	<section class="secondary_bar">
		<div class="breadcrumbs_container">
			<article class="breadcrumbs"><a href="<!--{:Q::U('public/fmain')}-->"><!--<lang package='Template'>-->主页<!--</lang>--></a> <div class="breadcrumb_divider"></div> <a class="current">修改VIP模板</a></article>
		</div>
	</section>

	<section id="main" class="column">
		<article class="module width_full">
			<header><h3><!--<lang package='Template'>-->操作提示<!--</lang>--></h3></header>
			<div class="module_content">
				<ul>
					<li>VIP模板设置，最多支持3张。</li>
				</ul>
			</div>
		</article>

		<article class="module width_full">
			<header><h3 class="tabs_involved">修改VIP模板</h3>
				<ul class="tabs">
					<li class="active"><a href="<!--{:Q::U('jiajucompanytemplate/index')}-->">VIP模板</a></li>
				</ul>
			</header>
			<form action="" method="post" id="templateAdd" class="validate">
				<div class="module_content">
					<table class="tablesorter" width="100%" cellspacing="0" cellpadding="0" border="0">
						<thead>
							<tr>
								<th width="220px">标题</th>
								<th width="220px">链接</th>
								<th>图片</th>
							</tr>
						</thead>
						<tr>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
							<td>
								<input style="float:left;width:300px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_1" value="<!--{if isset($arrCurrentTemplates[0]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[0]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片" onmouseover="globalPreviewImg('jiajucompanybanner_1');" onmouseout="unglobalPreviewImg('jiajucompanybanner_1');"/>&nbsp;
								<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg1',1,1);">
								&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_1').val('');">x</span>
							</td>
						</tr>
						<tr>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
							<td>
								<input style="float:left;width:300px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_2" value="<!--{if isset($arrCurrentTemplates[1]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[1]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片" onmouseover="globalPreviewImg('jiajucompanybanner_2');" onmouseout="unglobalPreviewImg('jiajucompanybanner_2');"/>&nbsp;
								<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg2',1,1);">
								&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_2').val('');">x</span>
							</td>
						</tr>
						<tr>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[title][]" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_filetitle'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_filetitle']}--><!--{/if}-->" title="标题" /></td>
							<td><input style="width:200px;" type="text" name="jiajucompanybanner[link][]" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_link'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_link']}--><!--{/if}-->" title="链接" /></td>
							<td>
								<input style="float:left;width:300px;" type="text" name="jiajucompanybanner[img][]" id="jiajucompanybanner_3" value="<!--{if isset($arrCurrentTemplates[2]['jiajucompanybanner_filename'])}--><!--{$arrCurrentTemplates[2]['jiajucompanybanner_filename']}--><!--{/if}-->" readonly title="广告图片" onmouseover="globalPreviewImg('jiajucompanybanner_3');" onmouseout="unglobalPreviewImg('jiajucompanybanner_3');"/>&nbsp;
								<input type="button" value="<!--<lang package='__COMMON_LANG__@Common'>-->媒体<!--</lang>-->" class="alt_btn" onclick="globalAddattachment('insertImg3',1,1);">
								&nbsp;<span class="red" style="cursor:pointer;" onclick="$('#jiajucompanybanner_3').val('');">x</span>
							</td>
						</tr>
						<tr>
							<td colspan="3">
								<div id="jiajucompanybanner_1-preview"></div>
								<div id="jiajucompanybanner_2-preview"></div>
								<div id="jiajucompanybanner_3-preview"></div>
							</td>
						</tr>
						<tr>
							<td>所选模板</td>
							<td colspan="2">
								<select name="jiajucompanyvip_template" id="jiajucompanyvip_template">
									<!--<foreach for="arrTemplate">-->
									<option value="<!--{$key}-->" data-img="<!--{$value[1]}-->" data-url="<!--{$value[2]}-->" <!--{if $sCurrentTemplate==$key}-->selected="selected"<!--{/if}-->><!--{$value[0]--}--></option>
									<!--</foreach>-->
								</select>
							</td>
						</tr>
						<tr>
							<td>顶部大图</td>
							<td colspan="2">
								<div id="preview-img"></div>
							</td>
						</tr>
					</table>
				</div>
				<footer>
					<div class="submit_link">
						<input type="hidden" name="ajax" value="1">
						<input type="button" id="submit_button" value="更新" class="alt_btn" onclick="updateTemplate();">
						&nbsp;<input type="reset" value="<!--<lang package='Template'>-->重置<!--</lang>-->">
					</div>
				</footer>
			</form>
		</article>

<!--<include file="public+footer">-->